package com.ruyuan.eshop.common.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruyuan.eshop.common.domain.dto.AfterSaleQueryParam;
import com.ruyuan.eshop.common.domain.entity.AfterSaleServiceDO;
import com.ruyuan.eshop.common.domain.vo.AfterSaleExportVO;

import java.util.List;

/**
 * 售后服务DAO接口
 * @author pwd
 * @version 1.0
 */
public interface AfterSaleServiceDAO extends IService<AfterSaleServiceDO> {

    /**
     * 查询需要导出的售后服务信息
     * @param disabled 售后服务单状态 NORMAL：正常，DELETE：删除
     * @param param 查询条件
     * @return
     */
    List<AfterSaleExportVO> selectExportVoList(String disabled, AfterSaleQueryParam param);

    /**
     * 分页查询售后服务单
     * @param param
     * @return
     */
    IPage<AfterSaleServiceDO> selectPage(AfterSaleQueryParam param);

    /**
     * 统计售后服务单数量
     * @param memberId
     * @param sellerId
     * @return
     */
    Integer selectCount(Long memberId, Long sellerId);

    /**
     * 获取售后服务单号
     * @param serviceSn
     * @return
     */
    AfterSaleServiceDO getService(String serviceSn);

    /**
     * 查询取消的售后服务单号
     * @param orderSn
     * @return
     */
    AfterSaleServiceDO getCancelService(String orderSn);

    /**
     * 跟新售后商家名称
     * @param shopId
     * @param shopName
     */
    void editAfterSaleShopName(Long shopId, String shopName);

    /**
     * 新增售后服务单
     * @param serviceDO
     */
    void addAfterSaleService(AfterSaleServiceDO serviceDO);

    /**
     * 更新售后服务单状态
     * @param serviceSn
     * @param serviceStatus
     */
    void updateServiceStatus(String serviceSn, String serviceStatus);

    /**
     * 更新售后服务单状态
     * @param serviceSn
     * @param serviceStatus
     * @param auditRemark
     * @param storageRemark
     * @param refundRemark
     * @param closeReason
     */
    void updateServiceStatus(String serviceSn, String serviceStatus, String auditRemark, String storageRemark, String refundRemark, String closeReason);

    /**
     * 售后服务单设置新的订单号
     * @param serviceSn
     * @param newOrderSn
     */
    void setServiceNewOrderSn(String serviceSn, String newOrderSn);

    /**
     * 更新退货地址
     * @param serviceSn
     * @param returnAddr
     */
    void updateReturnAddr(String serviceSn, String returnAddr);
}
